//
//  PayFeeHistoryViewController.m
//  PeopleStreet
//
//  Created by 刘建峰 on 2016/10/19.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "PayFeeHistoryViewController.h"
#import "PayFeeHistoryTableViewCell.h"
#import "PayFeeHisHeaderTableViewCell.h"
static NSString * headerCellIndentifier = @"PayFeeHisHeaderTableViewCell";
static NSString * cellIndentifier = @"PayFeeHistoryTableViewCell";


@interface PayFeeHistoryViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UIView *navView;
@property (weak, nonatomic) IBOutlet UITableView *tableView;


@end

@implementation PayFeeHistoryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initViewLayout];
    // Do any additional setup after loading the view.
}

- (void)initViewLayout{
    [self adaptiveViewLayout:self.view];
    [self adaptiveViewLayout:self.navView];
    
    [self.tableView registerNib:[UINib nibWithNibName:cellIndentifier bundle:nil] forCellReuseIdentifier:cellIndentifier];
    [self.tableView registerNib:[UINib nibWithNibName:headerCellIndentifier bundle:nil] forCellReuseIdentifier:headerCellIndentifier];
    _tableView.dataSource = self;
    _tableView.delegate = self;
}

- (IBAction)back:(id)sender {
    [self.navigationController  popViewControllerAnimated:YES];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 3;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0 ) {
        return 25*VerticalRatio();
    }else{
        return 68*VerticalRatio();
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0 ) {
        PayFeeHisHeaderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:headerCellIndentifier];
        if (cell == nil) {
            cell= [[PayFeeHisHeaderTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:headerCellIndentifier];
        }
        
//        NSDictionary * dic = _listArray[indexPath.row];
//        
//        cell.superTitle.text  = [NSString stringWithFormat:@"%@",dic[@"mmdeName"]];
//        cell.superDetail.text  = [NSString stringWithFormat:@"%@",dic[@"mmdeContent"]];
//        cell.time.text = [ NSString stringWithFormat:@"%@",dic[@"mmdeCreateTime"]];
//        if ([NSString stringWithFormat:@"%@",dic[@"mmdeCreateTime"] ].length>0) {
//            cell.time.text = [Common updateTimeForData:[NSString stringWithFormat:@"%@",dic[@"mmdeCreateTime"] ]];
//        }
//        
        return cell;
    }else{
        PayFeeHistoryTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIndentifier];
        if (cell == nil) {
            cell= [[PayFeeHistoryTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIndentifier];
        }
//        NSDictionary * dic = _listArray[indexPath.row];
//        
//        NSString * image = [NSString stringWithFormat:@"%@",dic[@"mmsuImageUrl"]];
//        if (image.length>0) {
//            [cell.farmImage sd_setImageWithURL:[NSURL URLWithString:image]];
//        }
//        cell.farmTitle.text  = [NSString stringWithFormat:@"%@",dic[@"mmsuName"]];
//        cell.farmDetail.text  = [NSString stringWithFormat:@"%@",dic[@"mmsuContent"]];
//        if ([NSString stringWithFormat:@"%@",dic[@"mmsuCreateTime"] ].length>0) {
//            cell.time.text = [Common updateTimeForData:[NSString stringWithFormat:@"%@",dic[@"mmsuCreateTime"] ]];
//        }
        return cell;
    }
    
    return nil;
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
